package com.tqjc.system.common.enums;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.Arrays;

/**
 * @author 86195
 * @version 1.0
 * @description 槽车枚举类型
 * @date 2023/11/10 16:27
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum TankCarNoEnum {

    /**
     * PLCInfoArray   目标位置[地址,数据类型,label] 任务类型[]  允许移动[]
     */
    NO_1("1",95400,"1号过跨车",2,"1号过跨车重量","过跨槽车",
            new Object[][]{{"DB19.2.0",4,"1号过跨车目标位置"},{"DB19.28.0",2,"1号过跨车任务类型"},
            {"DB19.26.0",0,"1号过跨车允许移动"}},"1","2","3","1号槽车"),
    NO_2("2",91482,"2号过跨车",2,"2号过跨车重量","过跨槽车",
            new Object[][]{{"DB19.6.0",4,"2号过跨车目标位置"},{"DB19.30.0",2,"2号过跨车任务类型"},
            {"DB19.26.1",0,"2号过跨车允许移动"}},"1","2","3","2号槽车"),
    NO_3("3",111110,"3号过跨车",1,"3号过跨车重量","过跨槽车",
            new Object[][]{{"DB19.10.0",4,"3号过跨车目标位置"},{"DB19.32.0",2,"3号过跨车任务类型"},
            {"DB19.26.2",0,"3号过跨车允许移动"}},"1","2","3","3号槽车");

    /**
     * 槽车编码
     */
    private String tankCarNo;

    private int xIndex;

    private String tankName;

    /**
     * 扫描编号
     */
    private int scannerNo;


    private String weightLabel;



    /**
     *macSN
     */
    private String macSN;

    /**
     * 移动点位信息   目标位置[地址,数据类型] 任务类型[]  允许移动[]
     */
    private Object[][] PLCInfoArray;



    private String wasteSteelIndex;


    private String dregsSteelIndex;

    private String heatIndex;

    /**
     * 槽车描述
     */
    private String desc;


    public static TankCarNoEnum getEnum(String tankCarNo){
        for (TankCarNoEnum tankCarNoEnum : TankCarNoEnum.values()) {
            if(tankCarNoEnum.getTankCarNo().equals(tankCarNo)){
                return tankCarNoEnum;
            }

        }
        return null;
    }



    public static TankCarNoEnum getEnumBymacSN(String macSN){
        for (TankCarNoEnum tankCarNoEnum : TankCarNoEnum.values()) {
            if(tankCarNoEnum.getMacSN().equals(macSN)){
                return tankCarNoEnum;
            }

        }
        return null;
    }


    public static TankCarNoEnum getEnumByCarNo(String tankCarNo){
        for (TankCarNoEnum tankCarNoEnum : TankCarNoEnum.values()) {
            if(tankCarNoEnum.getTankCarNo().equals(tankCarNo)){
                return tankCarNoEnum;
            }

        }
        return null;
    }


    public static String getDescByCarNo(String tankCarNo){
        for (TankCarNoEnum tankCarNoEnum : TankCarNoEnum.values()) {
            if(tankCarNoEnum.getTankCarNo().equals(tankCarNo)){
                return tankCarNoEnum.getDesc();
            }

        }
        return "未知槽车";
    }









}
